package com.qianfeng.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qianfeng.entity.dto.Admin;
import com.qianfeng.mapper.AdminMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class AdminService extends ServiceImpl<AdminMapper, Admin> {

    @Transactional(readOnly = true)
    public Admin getByUsername(String username){
        QueryWrapper<Admin> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(Admin::getUsername , username);
        return this.getOne(wrapper);
    }

}
